<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/master.xhtml">

        <ui:define name="menu">
            <ui:include src="../menu.xhtml" /> 
        </ui:define>
        
        <ui:define name="TituloModulo">
            Gestão de Financeira
        </ui:define>

        <ui:define name="TituloConteudoPrincipal">
            Criar Conta
        </ui:define>

        <ui:define name="ConteudoPrincipal">

            <p:messages globalOnly="true"/>

            <h:form>
                <h:panelGrid columns="3">
                    <h:outputLabel value="#{bundle.nomeConta}" for="nomeConta" />
                    <p:inputText id="nomeConta" value="#{contaController.selected.nomeConta}" title="#{bundle.nomeConta}" required="true" requiredMessage="#{bundle.obrigatorio}" />
                    <p:message for="nomeConta"/>
                    <h:outputLabel value="#{bundle.numeroConta}" for="numeroConta" />
                    <p:inputText id="numeroConta" value="#{contaController.selected.numeroConta}" title="#{bundle.numeroConta}" required="true" requiredMessage="#{bundle.obrigatorio}"/>
                    <p:message for="numeroConta"/>
                    <h:outputLabel value="#{bundle.idTipoConta}" for="idTipoConta" />
                    <p:selectOneMenu id="idTipoConta" value="#{contaController.selected.idTipoConta}"  required="true" requiredMessage="#{bundle.obrigatorio}">
                        <f:selectItems value="#{tipoContaController.itemsAvailableSelectOne}"/>
                    </p:selectOneMenu>
                    <p:message for="idTipoConta"/>
                </h:panelGrid>

                <p:commandButton ajax="false" action="#{contaController.create}" value="#{bundle.salvar}" icon="ui-icon-disk"/>

                <p:commandButton ajax="false" action="#{contaController.prepareList}" value="#{bundle.listar}" immediate="true"/>

            </h:form>
        </ui:define>
    </ui:composition>

</html>
